#include <iostream>
#include <vector>
#include <queue>
using namespace std;
const int N=1e5*2+10;
int main() {
    int n, m;
    cin >> n >> m;
    vector<int> edge[N];
    vector<int> in(N);
    for (int i = 1; i <= m; i++) {
        int x, y;
        cin >> x >> y;
        edge[x].push_back(y);
        in[y]++;
    }
    queue<int> q;
    for(int i=1;i<=n;i++)
    {
        if(in[i]==0)
            q.push(i);
    }
    vector<int> ret;
    int cnt=0;
    while(q.size())
    {
        int x=q.front();
        ret.push_back(x);
        q.pop();
        for(auto& k:edge[x])
        {
            in[k]--;
            if(in[k]==0)
                q.push(k);
        }
        cnt++;
    }

    if (cnt==n) {
        for (int i = 0; i < ret.size()-1; i++) {
            cout << ret[i] << ' ';
        }
        cout<<ret[ret.size()-1];
    } else {
        cout << "-1";
    }
    return 0;
}
